package Controller;

import java.io.IOException;

public class MenuController {

    //重新开始
    public void AfreshController(){
        try {
            // 获取当前工作目录
            String currentDir = System.getProperty("user.dir");

            ProcessBuilder builder = new ProcessBuilder(
                    System.getProperty("java.home") + "/bin/java",
                    "-cp", System.getProperty("java.class.path"),
                    "main"
            );

            // 使用当前工作目录作为相对路径
            builder.directory(new java.io.File(currentDir));
            builder.start();
            System.exit(0);

        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
    //退出游戏
    public void QuitController(){
        System.exit(0);
    }
    //关于
    public void AboutController(){

    }
}
